<?php

namespace App\Providers;

use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;

class Repositories extends ServiceProvider
{
    protected $defer = true;

    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(
            \App\Contracts\Repositories\QuizRepository::class,
            \App\Morefun\Quiz\QuizRepository::class
        );

        $this->app->singleton(
            \App\Contracts\Repositories\Quiz\OptionRepository::class,
            \App\Morefun\Quiz\OptionRepository::class
        );

        $this->app->singleton(
            \App\Contracts\Repositories\Quiz\SheetRepository::class,
            \App\Morefun\Quiz\SheetRepository::class
        );

        $this->app->singleton(
            \App\Contracts\Repositories\Quiz\PaperRepository::class,
            \App\Morefun\Quiz\PaperRepository::class
        );
    }

    public function provides()
    {
        return [
            \App\Contracts\Repositories\QuizRepository::class,
            \App\Contracts\Repositories\Quiz\OptionRepository::class,
            \App\Contracts\Repositories\Quiz\SheetRepository::class,
            \App\Contracts\Repositories\Quiz\PaperRepository::class,
        ];
    }
}
